package com.heima.user.controller;


import com.heima.apis.user.ApUserRealnameControllerApi;
import com.heima.common.contans.user.UserContans;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.AuthDto;
import com.heima.user.service.AdUserRealNameService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/auth")
public class AdUserRealNameController implements ApUserRealnameControllerApi {
    @Autowired
    private AdUserRealNameService adUserRealNameService;

    @PostMapping("/list")
    @Override
    public ResponseResult loadListByStatus(@RequestBody AuthDto authDto) {
        return adUserRealNameService.loadListByStatus(authDto);
    }

    @PostMapping("/authPass")
    @Override
    public ResponseResult authPass(@RequestBody AuthDto authDto) {
        return adUserRealNameService.updateStatusById(authDto , UserContans.PASS_AUTH);
    }

    @PostMapping("/authFail")
    @Override
    public ResponseResult authFail(@RequestBody AuthDto authDto) {
        return adUserRealNameService.updateStatusById(authDto , UserContans.FAIL_AUTH);
    }


}
